import React, { PureComponent } from 'react';
import style from "styled-components";
// import { Modal, Button ,Form, Input, Select } from 'antd';
import "./InsuranceMangerment.less";
// import Insurance from "./InsuranceBasic";
import Insurance from "./../../Enterprise/Company/InsuranceBasic";
import styles from './../../Enterprise/Company/Company.less';
// import styles from './Company.less';
// const FormItem = Form.Item;
// const { Option } = Select;
// @Form.create()
export default class EnterpriseInsurance extends PureComponent {
  constructor(props, context) {
    super(props, context);
    this.state = {
    //   shows: [true, false, false, false],//各个 tab 内容是否显示，这里按需加载
    // policyHolder: "百川信（厦门）网络信息服务有限公司",
    // contacts: "",
    // contactsinformation: "",
    // enterprises: "",
    // premium:[],
    // amountmoney:[],
    // accessbookvisible:false,
    // disabled: true,
    };

  }
  // // state = { accessbookvisible:false, }
  //   // 获取方案书
  //   showaccessbookModal = () => {
  //     this.setState({
  //       accessbookvisible:true,
  //     });
  //   }
  //   handlereducepeopleOk = (e) => {
  //     console.log(e);
  //     this.setState({
  //       accessbookvisible:false,
  //     });
  //   }
  //   handlereducepeopleCancel = (e) => {
  //     console.log(e);
  //     this.setState({
  //       accessbookvisible:false,
  //     });
  //   }
  //   handleSubmit = e => {
  //     e.preventDefault();
  //     this.props.form.validateFieldsAndScroll((err, values) => {
  //       if (!err) {
  //        console.log('表单提交中.........',values);
  //       }
  //     });
  //   };
  render() {
    // console.log('aa',this.state.disabled);
    //   console.log('bb',this.state.accessbookvisible);
    // const { submitting } = this.props;
    // const { getFieldDecorator } = this.props.form;

    // const formItemLayout = {
    //   labelCol: {
    //     xs: { span: 7 },
    //     sm: { span: 7 }
    //   },
    //   wrapperCol: {
    //     xs: { span: 15 },
    //     sm: { span: 15 },
    //     md: { span: 15 }
    //   }
    // };

    // const submitFormLayout = {
    //   wrapperCol: {
    //     xs: { span: 15, offset: 7 },
    //     sm: { span: 15, offset: 7 }
    //   }
    // };
    // // const { policyHolder, contacts, contactsinformation, enterprises, amountmoney,premium} = this.state;
    // const amountmoney = [
    //   {"code":0,"price":10},
    //   {"code":1,"price":20},
    // ];
    // const premium = [
    //   {"code":0,"price":10},
    //   {"code":1,"price":20},
    // ];
    return (
      <Container>
        <Insurance props={this.props} styles={styles}/>
        {/* <div>
          <Modal className="accessbook"
            title="获取方案书"
            visible={this.state.accessbookvisible}
            onOk={this.handlereducepeopleOk}
            onCancel={this.handlereducepeopleCancel}
            footer={null}>
            <div style={{paddingBottom:16}}>
              <Form onSubmit={this.handleSubmit} style={{ marginTop: 24 }}>
                <FormItem {...formItemLayout} label="投保人">
                  {getFieldDecorator("policyHolder", {
                    // {}
                    initialValue: this.state.policyHolder,
                    rules: [{ message: "请填写" }]
                  })(<Input disabled={this.state.disabled}/>)}
                </FormItem>
                <FormItem {...formItemLayout} label="联系人">
                  {getFieldDecorator("contacts", {
                    initialValue: this.state.contacts,
                    rules: [{ required: true, message: "请填写" }]
                  })(<Input/>)}
                </FormItem>
                <FormItem {...formItemLayout} label="联系方式">
                  {getFieldDecorator("contactsinformation", {
                    initialValue: this.state.contactsinformation,
                    rules: [{ required: true, message: "请填写" }]
                  })(<Input/>)}
                </FormItem>
                <FormItem {...formItemLayout} label="企业人数">
                  {getFieldDecorator("enterprises", {
                    initialValue: this.state.enterprises,
                    rules: [{ message: "请填写" }]
                  })(<Input/>)}
                </FormItem>
                <FormItem {...formItemLayout} label="保障金额不低于">
                  {getFieldDecorator("amountmoney", {
                    initialValue: this.state.amountmoney,
                    rules: [{ required: true, message: "请选择" }]
                  })(
                    <Select placeholder="请选择">
                      {amountmoney.map((val, index) => {
                        return (
                          <Option key={index} value={val.code}>
                            {val.price}
                          </Option>
                        );
                      })}
                    </Select>
                  )}
                </FormItem>
                <FormItem {...formItemLayout} label="保费不超过">
                  {getFieldDecorator("premium", {
                    initialValue: this.state.premium,
                    rules: [{ required: true, message: "请选择" }]
                  })(
                    <Select placeholder="请选择">
                      {premium.map((val, index) => {
                        return (
                          <Option key={index} value={val.code}>
                            {val.price}
                          </Option>
                        );
                      })}
                    </Select>
                  )}
                </FormItem>
                <FormItem {...submitFormLayout} style={{marginBottom:0}}>
                  <Button loading={submitting} onClick={this.handlereducepeopleCancel}>晚点再看</Button>
                  <Button type="primary" style={{ marginLeft: 8 }} htmlType="submit">下一步</Button>
                </FormItem>
              </Form>
            </div>
          </Modal>
        </div> */}
      </Container>
    );
  }
}

const Container = style.div`
  padding:24px;
`;
